package net.bithappens.hnqe.mapper.graphxml;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class PropertyBean {

	private String mapperId;

	private Collection<InstanceConfigBean> instanceConfigs;
	
	
	public String getMapperId() {
		return mapperId;
	}

	public void setMapperId(String mapperId) {
		this.mapperId = mapperId;
	}

	public Collection<InstanceConfigBean> getInstanceConfigs() {
		return instanceConfigs;
	}

	public void setInstanceConfigs(Collection<InstanceConfigBean> instanceConfigs) {
		this.instanceConfigs = instanceConfigs;
	}
	
	
	public Collection<InstanceConfigBean> getConfigsForInstance(String instanceId){
		
		List<InstanceConfigBean> configs = new ArrayList<InstanceConfigBean>();
		
		for(InstanceConfigBean instanceConfig : instanceConfigs){
			if(instanceConfig.getInstanceId().equals(instanceId)){
				configs.add(instanceConfig);
			}
		}
		
		if(configs.size() == 0){
			return null;
		}
		return configs;
	}
	
}
